package day0519;
//用身高体重计算肥胖指数
public class Test3 {
    //main函数：让本文件能运行
    public static void main(String[] args) {
        //1.定义两个double变量 weight height并赋值
        double weight=60;
        double height=1.7;
        //2. double bmi = weight/  (height*height);
        double bmi = weight/  (height*height);
        //3. bmi<18.5  满足， 就打印  "太瘦了"
        if(0<bmi && bmi<18.5){
            System.out.println("太瘦了");
        }else if(18.5<=bmi&& bmi<=24){
            System.out.println("身材完美");
        }else if( bmi > 24){
            System.out.println("偏胖");
        }else{
            System.out.println("输入的数据无效");
        }


        /*if(bmi<18.5){
            System.out.println("太瘦了");
        }
        //   18.5<=bmi&& bmi<=24  满足， 就打印  "身材完美"
        if(18.5<=bmi&& bmi<=24){
            System.out.println("身材完美");
        }
        //   24<=bmi  满足， 就打印  "偏胖"
        if(24<=bmi){
            System.out.println("偏胖");
        }*/
    }
}
